<html>
<head>
<title>Add 產品報告</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link media="all" href="/cms/css/cms.min.css" type="text/css" rel="stylesheet" /> 
<link rel="stylesheet" type="text/css" href="/cms/css/tag/token-input.css" />
<script  type="text/javascript" src="/cms/js/cms.1.1.min.js"></script>
<script type="text/javascript" src="/cms/js/tag/jquery.tokeninput.js"></script> 
<script language="JavaScript" src="/cms/js/cleditor/jquery.cleditor.min.js"></script>
<script language="JavaScript" src="/cms/js/jquery.validate.js"></script>
<script language="JavaScript" src="/cms/js/autocomplete/textarea.js"></script>

</head>

<body>
{#include file="$navigation"#}
<div style="float:right;" id="login"></div>

<script>
$(document).ready(function() {	

});	
  function validate_form(form){
	  if (validator.form())  form.submit(); else alert('Some fields has error. Please check and resubmit');
  }
</script>

<H1><span id="parent_key_label"></span>產品報告</H1>
<form name="form_showadd" method="post" id="form_showadd" action="{#$self_url#}" >	
<div class='tableWrapper' style="width:100%;margin:0;padding:0;">
  <div class='tableHeader' >

	<ul class="tableActions">
  <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存 " onclick="form.subaction.value='edit_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" type="submit" name="Submit" value=" 確定 "></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存並新增 " onclick="form.subaction.value='showadd_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="dummy" value=" 取消 " size="3" onclick="javascript:window.location.href='{#$self_url#}/list/{#$oid#}'" type="button"></li>
	</ul>

  <div class='clear'></div>
  <div class='corner left'></div>
  <div class='corner right'></div>
  </div>	
<table border="0" cellspacing='0' >

<tr id="tr_mid"><td><B>會員編號</B></td>
<td id="td_mid">{#$showadd_data.mid#}</td></tr>
<tr id="tr_title"><td><B>title</B></td>
<td id="td_title"><input id="field_title" type="text" name="title" value=""></td></tr>
<tr id="tr_agegroup"><td><B>agegroup</B></td>
<td id="td_agegroup">{#$showadd_data.agegroup#}</td></tr>
<tr id="tr_content_json"><td><B>用戶數據</B> <img src="/cms/images/ico/info.gif" class="tips" title="json 保存用戶圖文數據" /></td>
<td id="td_content_json"><input id="field_content_json" type="text" name="content_json" value=""></td></tr>
<tr id="tr_body"><td><B>報告內容</B></td>
<td id="td_body"><input id="field_body" type="text" name="body" value=""></td></tr>
<tr id="tr_likes"><td><B>likes</B></td>
<td id="td_likes"><input id="field_likes" type="text" name="likes" value=""></td></tr>
<tr id="tr_well"><td><B>總評</B> <img src="/cms/images/ico/info.gif" class="tips" title="1：很好  2：好 3：一般  4：差 " /></td>
<td id="td_well"><input id="field_well" type="text" name="well" value=""></td></tr>
<tr id="tr_category_scores"><td><B>類別評分</B></td>
<td id="td_category_scores"><input id="field_category_scores" type="text" name="category_scores" value=""></td></tr>
<tr id="tr_category_name1"><td><B> </B></td>
<td id="td_category_name1"><input id="field_category_name1" type="text" name="category_name1" value=""></td></tr>
<tr id="tr_category_score1"><td><B> category_score1</B></td>
<td id="td_category_score1"><input id="field_category_score1" type="text" name="category_score1" value=""></td></tr>
<tr id="tr_category_name2"><td><B> </B></td>
<td id="td_category_name2"><input id="field_category_name2" type="text" name="category_name2" value=""></td></tr>
<tr id="tr_category_score2"><td><B> category_score2</B></td>
<td id="td_category_score2"><input id="field_category_score2" type="text" name="category_score2" value=""></td></tr>
<tr id="tr_category_name3"><td><B> </B></td>
<td id="td_category_name3"><input id="field_category_name3" type="text" name="category_name3" value=""></td></tr>
<tr id="tr_category_score3"><td><B> category_score3</B></td>
<td id="td_category_score3"><input id="field_category_score3" type="text" name="category_score3" value=""></td></tr>
<tr id="tr_category_name4"><td><B> </B></td>
<td id="td_category_name4"><input id="field_category_name4" type="text" name="category_name4" value=""></td></tr>
<tr id="tr_category_score4"><td><B> category_score4</B></td>
<td id="td_category_score4"><input id="field_category_score4" type="text" name="category_score4" value=""></td></tr>
<tr id="tr_fb_share_num_base"><td><B>Facebook Share 基數</B></td>
<td id="td_fb_share_num_base">{#$showadd_data.fb_share_num_base#}</td></tr>
<tr id="tr_likes_num_base"><td><B>Facebook 推介/Like 基數</B></td>
<td id="td_likes_num_base">{#$showadd_data.likes_num_base#}</td></tr>
<tr id="tr_category_name5"><td><B> </B></td>
<td id="td_category_name5"><input id="field_category_name5" type="text" name="category_name5" value=""></td></tr>
<tr id="tr_category_score5"><td><B> category_score5</B></td>
<td id="td_category_score5"><input id="field_category_score5" type="text" name="category_score5" value=""></td></tr>
<tr id="tr_category_name6"><td><B> </B></td>
<td id="td_category_name6"><input id="field_category_name6" type="text" name="category_name6" value=""></td></tr>
<tr id="tr_category_score6"><td><B>category_score6</B></td>
<td id="td_category_score6"><input id="field_category_score6" type="text" name="category_score6" value=""></td></tr>
<tr id="tr_category_name7"><td><B> </B></td>
<td id="td_category_name7"><input id="field_category_name7" type="text" name="category_name7" value=""></td></tr>
<tr id="tr_category_score7"><td><B>category_score7</B></td>
<td id="td_category_score7"><input id="field_category_score7" type="text" name="category_score7" value=""></td></tr>
<tr id="tr_category_name8"><td><B> </B></td>
<td id="td_category_name8"><input id="field_category_name8" type="text" name="category_name8" value=""></td></tr>
<tr id="tr_category_score8"><td><B>category_score8</B></td>
<td id="td_category_score8"><input id="field_category_score8" type="text" name="category_score8" value=""></td></tr>
<tr id="tr_is_valid"><td><B>有效</B></td>
<td id="td_is_valid"><input id="field_is_valid" type="text" name="is_valid" value=""></td></tr>
<tr id="tr_discuz_pid"><td><B>discuz_pid</B> <img src="/cms/images/ico/info.gif" class="tips" title="對應discuz的一個回帖id" /></td>
<td id="td_discuz_pid"><input id="field_discuz_pid" type="text" name="discuz_pid" value=""></td></tr>
<tr id="tr_priority"><td><B>優先順序(大至小）</B> <img src="/cms/images/ico/info.gif" class="tips" title="數字愈大,愈排得前<BR/>如次序相同,再以addtime 來排, 愈早愈排得前" /></td>
<td id="td_priority">{#$showadd_data.priority#}</td></tr>
<tr id="tr_grade"><td><B>評分</B></td>
<td id="td_grade">{#$showadd_data.grade#}</td></tr>
<tr id="tr_reject_reason"><td><B>不接受原因</B></td>
<td id="td_reject_reason">{#$showadd_data.reject_reason#}</td></tr>
<tr id="tr_is_accept"><td><B>是否接受</B></td>
<td id="td_is_accept">{#$showadd_data.is_accept#}</td></tr>
<tr id="tr_is_publish"><td><B>已發佈</B> <img src="/cms/images/ico/info.gif" class="tips" title="否 - 草稿 (尚未發佈)<BR/>是 - 發佈" /></td>
<td id="td_is_publish">{#$showadd_data.is_publish#}</td></tr>

  <tr>
    <td>&nbsp;</td>
    <td>
     	<input type="hidden" name="oid" value="{#$oid#}">
    <input type="hidden" name="action" value="add"><input name="subaction" type="hidden">
     <ul class="tableActions">
    <li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存 " onclick="form.subaction.value='edit_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" type="submit" name="Submit" value=" 確定 "></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="Submit" value=" 儲存並新增 " onclick="form.subaction.value='showadd_after_add'; form.submit();" type="button"></li><li><input class="psbutton" onmouseover="this.className='psbuttonhover'" onmouseout="this.className='psbutton'" name="dummy" value=" 取消 " size="3" onclick="javascript:window.location.href='{#$self_url#}/list/{#$oid#}'" type="button"></li>
    </ul>
  </td>
  </tr>
</table>

</form>

<script type="text/javascript"> 	
$(function(){
  $(".tips").tipTip({defaultPosition: "right", edgeOffset: 10});
}); 
</script>

<script type="text/javascript">
//$(function(){
//});

//$(document).ready(function() {	
//});
</script>

<script type="text/javascript">

function hidden_rows_by_type(type){

  var myArray = [
    [''], // show when type = 1 is selected
    [ ''] ,  // show when type = 2 is selected
  ];

  for (var i=0; i<myArray.length; i++) {
    if (type == i + 1){
       for (var j=0; j<myArray[i].length; j++){
         $('#tr_'+myArray[i][j]).show();
       }
    } else {
       for (var j=0; j<myArray[i].length; j++){
        $('#tr_'+myArray[i][j]).hide();
       }
    }
  }
}

$(document).ready(function() {	
/*
   var fieldname = 'is_accept';

	var type = parseInt($('[name|="'+fieldname+'"]').val());
	hidden_rows_by_type(type);

	$('[name|="'+fieldname+'"]').change(function() {
		hidden_rows_by_type(parseInt($(this).val()));
	});
*/
	var is_accept = $('input:radio[name=is_accept]:checked').val();
	if(is_accept == 1){

		$("#tr_grade").show();
		$("#tr_reject_reason").hide();
	}else{
		$("#tr_grade").hide();
		$("#tr_reject_reason").show();

        }

	$('input:radio[name=is_accept]').click(function(){
		if($(this).val() == 1){
		   $("#tr_grade").show();
		   $("#tr_reject_reason").hide();
		}else{
		$("#tr_grade").hide();
		$("#tr_reject_reason").show();
}
	});
});

</script> 
<!--POSTRUNJS-->
</body>
</html>
